package ink.metoo.gude.properties

import ink.metoo.gude.GudeServerApplication.Companion.BASE_CONFIG_PREFIX
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.stereotype.Component

@Component
@ConfigurationProperties("${BASE_CONFIG_PREFIX}.cloudflare")
data class CloudflareProperties(
    /**
     * Cloudflare 的账户ID
     */
    var authId: String? = null,
    /**
     * AI配置
     */
    var ai: Ai = Ai(),
    /**
     * R2配置
     */
    var r2: R2 = R2(),
) {

    data class R2(
        var enable: Boolean = false,
        var accessKeyId: String? = null,
        var secretAccessKey: String? = null,
        var bucket: String? = null,
        var domain: String = "https://example.com",
    )

    data class Ai(

        /**
         * Cloudflare AI 的 API 密钥
         */
        var token: String? = null,

        /**
         * 对话使用的模型
         */
        var chatModel: String? = null,

        var systemPrompt: String = "if not specified, the default language is Chinese.",
    )

}